package com.test.www;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;

import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.junit.Test;

import com.shoping.dao.shop;
import com.shoping.pojo.User;

public class test {
	@Test
	public void ce(){
		try {
			InputStream in = Resources.getResourceAsStream("SqlMapConfig.xml");
			SqlSessionFactory build = new SqlSessionFactoryBuilder().build(in);
			SqlSession se = build.openSession();
			shop sp =se.getMapper(shop.class);
			List<User> list =sp.selAll();
			for (User user : list) {
				System.out.println(user);
			}
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
